class Solution {
public:
    vector<int> singleNumbers(vector<int>& nums) 
    {
        int eor = 0;
        for (auto x : nums)
        {
            eor ^= x;
        }

        int rightone = eor & (-eor); 
        

        int leftnum = eor; 
        for (auto x : nums)
        {
            if ((x & rightone) == 0)
            {
                leftnum ^= x; 
            }
        }
        int rightnum = eor ^ leftnum;

        vector<int> ans;
        ans.push_back(leftnum);
        ans.push_back(rightnum);

        return ans;
    }
};
